<template>
    <div class="event map">
        <!-- 事件列表 -->
        <div class="event-list" v-if="!editState">
            <div class="el-timeline" v-for="(item, index) in currentElement.event" :key="index" @click="openUpdateEventPanel(item, index)">
                <i class=" el-icon-delete" title="删除" v-on:click.stop="removeElementEvent(item)"></i>
                <i class="el-icon-copy-document" title="复制" @click.stop="copyElementEvent(item)"></i>
                <div class="event-warp-title">
                    <span>{{ getEventName(item.event) }}</span>
                </div>
                <div class="event-warp">
                    <!-- <img class="evevt-icon" src="../../../image/main/event_start.svg" alt=""> -->
                    <img class="evevt-icon" src="../../../image/main/event_action_event.svg" alt="">
                    <div class="evevt-divider"></div>
                    {{getEventName(item.action)}}
                </div>
                <div class="event-warp" v-show="item.action !== 'initEvent'">
                    <!-- <img class="evevt-icon" src="../../../image/main/event_trigger.svg" alt=""> -->
                    <img class="evevt-icon" src="../../../image/main/event_action_event.svg" alt="">
                    <div class="evevt-divider"></div>
                    分组： {{item.group}}
                </div>
                <div class="event-warp">
                    <!-- <img class="evevt-icon" src="../../../image/main/event_action.svg" alt=""> -->
                    <img class="evevt-icon" src="../../../image/main/event_action_event.svg" alt="">
                    <div class="event-param">
                        <span v-if="item.event === 'alert'">{{ item.param }}</span>
                        <span v-else-if="item.event === 'visit'">
                            <span v-for="(label_index, index) in item.param" :key="index">
                                {{ pageList[label_index].name }}
                                <span v-show="index < item.param.length - 1">、</span>
                            </span>
                        </span>
                        <span v-else-if="item.event === 'view'">
                            {{ item.param.nodeIP + ':' + item.param.playerPort }}
                        </span>
                        <span v-else-if="item.event === 'interactive'">
                            {{ explorerList.filter(_ => _.value == item.param.activeInterac)[0].label || '' }}
                        </span>
                        <span v-else-if="item.event === 'viewExplorer'">
                            {{ item.param.name }}
                        </span>
                        <span v-else-if="item.event === 'block'">
                            {{ item.param }}
                        </span>
                    </div>
                </div>
            </div>
        </div>
        <!-- 事件类型 -->
        <div class="event-type" v-else>
            <!-- 通用 -->
            <div class="main-text-tran-50 event-attr-wrap">
                <div class="event-attr-name">类型</div>
                <div class="event-attr-content main-mas-input-simple">
                    <select class="main-mas-basis-select" :id="window.getRootName() + 'EVENT_TYPE'" v-model="activeType">
                        <option v-for="(item, index) in eventTypeList[currentElement.component] ? eventTypeList[currentElement.component] : eventTypeList.common" :key="index" :value="item.action">{{item.label}}</option>
                    </select>
                </div>
            </div>
            <div class="main-text-tran-50 event-attr-wrap" v-show="activeType !== 'initEvent'">
                <div class="event-attr-name">分组</div>
                <div class="event-attr-content main-mas-input-simple">
                    <select class="main-mas-basis-select" :id="window.getRootName() + 'EVENT_GROUP'">
                        <option v-for="(item, index) in eventTypeList.TimerGroupOption" :key="index" :label="item.label" :value="item.value"></option>
                    </select>
                </div>
            </div>
            <!-- 定时器 -->
            <div class="main-text-tran-50" v-if="currentElement.component === 'Timing'">
                <div class="event-attr-wrap">
                    <div class="event-attr-name">时间</div>
                    <div class="event-attr-content">
                        <el-input type="number" size="mini" v-model="timer.time" placeholder="请输入"></el-input>
                    </div>
                    (毫秒)
                </div>
            </div>
            <!-- 层级树 -->
            <div class="main-text-tran-50" v-if="currentElement.component == 'Tree'">
                层级树
                <el-tree :data="currentElement.data" ref="levelTree" :expand-on-click-node="false" node-key="id" :props="defaultProps" highlight-current @node-click="(data, node, item) => handleNodeClick(data, node, item, 'levelTree')"></el-tree>
            </div>
            <!-- 导航 -->
            <div class="main-text-tran-50" v-if="currentElement.component == 'Menu'">
                菜单
                <el-tree :data="currentElement.data" ref="menuTree" :expand-on-click-node="false" node-key="id" :props="defaultProps" highlight-current @node-click="(data, node, item) => handleNodeClick(data, node, item, 'menuTree')"></el-tree>
            </div>
            <div class="main-text-tran-50 event-attr-wrap">
                <div class="event-attr-name">类型</div>
                <div class="event-attr-content main-mas-input-simple">
                    <select class="main-mas-basis-select" :id="window.getRootName() + 'EVENTLIST'" v-model="activeName">
                        <option v-for="(item, index) in eventList" :key="index" :label="getEventName(item.key)" :value="item.key"></option>
                    </select>
                </div>
            </div>
            <component class="page-warp" :is="eventMap[activeName]" ref="componentEvent" :eventData="eventData"></component>
            <!-- <el-tabs v-model="activeName" @tab-click="tabClick" stretch>
                <el-tab-pane v-for="(item, index) in eventList" :key="index" :label="getEventName(item.key)" :name="item.key">
                    <div v-if="item.key === 'alert'" class="page-warp">
                        <textarea :id="window.getRootName() + 'EVENT_MESSAGE'" :rows="4" placeholder="请输入要弹出的消息内容" />
                    </div>
                    <div v-else-if="item.key === 'visit'" class="page-warp">
                        <div class="exclusive-item" v-for="(item, index) in pageList" :key="index">
                            <input type="checkbox" name="page-check" :value="index" />
                            <span>{{item.name}}</span>
                        </div>
                    </div>
                    <div v-else-if="item.key === 'view'" class="page-warp">
                        <div v-if="cloudMapList.length">
                            <el-select style="width: 220px;" v-model="cloudMapComponent" @change="(item) => { setInstanceList(item.data.url, item.data); }" size="mini" placeholder="请选择">
                                <el-option v-show="item.data.url" v-for="item in cloudMapList" :key="item.id" :label="item.data.url" :value="item"></el-option>
                            </el-select>
                            <div class="map-content">
                                <div class="main-text-tran-50">
                                    <span>实例</span>
                                </div>
                                <div class="table">
                                    <div class="label" :class="item.id === activeInstanceid ? 'activeTable': ''" v-for="(item, index) in instanceList" :key="index" @click="setInstance(item)">
                                        <span>{{ item.project }}</span>
                                    </div>
                                </div>
                            </div>
                            <div class="map-content">
                                <div class="main-text-tran-50">
                                    <span>导览</span>
                                </div>
                                <div class="table">
                                    <div class="label" :class="item.id === activeViewid ? 'activeTable': ''" v-for="(item, index) in viewList" :key="index" @click="activeViewid = index">
                                        <span>{{ item.name }}</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="page-title" v-else>
                            暂无地图数据
                        </div>
                    </div>
                </el-tab-pane>
            </el-tabs> -->
        </div>
        <div class="add-event" @click="openAddEventPanel" v-if="!editState">添加事件</div>
        <div class="add-event" @click="paseEventPanel" v-if="!editState">粘贴事件</div>
        <div class="edit-btn" v-else>
            <div class="clear" @click="closePanel">取 消</div>
            <div class="affirm" @click="addElementEvent" v-if="editType === 'add'">添 加</div>
            <div class="affirm" @click="addElementEvent" v-else-if="editType === 'update'">提 交</div>
        </div>
    </div>
</template>

<script>
import event from '@/js/main/event.js';
import store from '@/js/store/state.js';
import util from '@/js/util/util.js';
// import { socket } from '@/js/util/connect.js';
import message from '@/js/util/message.js';
import history from '@/js/main/history.js';
import bus from '@/js/event/bus.js';
import array from '@/js/util/array.js';
import user from '@/js/util/user.js';

export default {
    components: {
        AlertEvent: () => import('@/view/main/Attribute/event/AlertEvent.vue'),
        InteractiveEvent: () => import('@/view/main/Attribute/event/InteractiveEvent.vue'),
        ViewExplorerEvent: () => import('@/view/main/Attribute/event/ViewExplorerEvent.vue'),
        ViewEvent: () => import('@/view/main/Attribute/event/ViewEvent.vue'),
        VisitEvent: () => import('@/view/main/Attribute/event/VisitEvent.vue'),
        BlockEvent: () => import('@/view/main/Attribute/event/BlockEvent.vue')
    },
    data() {
        return {
            window: window,
            editState: false,
            eventTypeList: event.eventTypeList,
            eventList: [],
            eventMap: event.eventMap,
            explorerList: event.explorerList,
            activeName: 'visit',
            activeType: 'click',
            pageList: store.getPageList(),
            activePageIndex: [0],
            // currentElementEventList: store.getCurrentElementList()[0].event,
            currentElement: store.getCurrentElementList()[0],
            cloudMapComponent: null,
            // cloudMapList: [],
            // instanceList: [],
            // viewList: [],
            // activeInstanceid: '',
            // activeViewid: -1,
            editType: 'add',
            editElementIndex: 0,
            timer: {
                time: 30000
            },
            treeActiveNode: null,
            defaultProps: {
                children: 'children',
                label: 'name'
            },
            eventData: [],
            eventPase: ''
        };
    },
    mounted() {
        if (user.getPanel() === 'true') {
            this.eventList = event.eventList.filter((res) => res.key !=='view');
        } else {
            this.eventList = event.eventList.filter((res) => res.key !=='viewExplorer');
        }
    },
    methods: {
        getEventName: event.getEventName,
        handleNodeClick(data, node, item, treeType) {
            this.treeActiveNode = data;
        },
        openAddEventPanel() {
            array.clear(this.eventData);
            this.editState = !this.editState;
            this.editType = 'add';
            this.clearData();
        },
        paseEventPanel() {
            let _this = this;
            if (user.getPanel() === 'true') {
                try {
                    if (JSON.parse(this.eventPase)) {
                        let obj = JSON.parse(this.eventPase);
                        if (['click', 'mouseenter', 'mouseleave', 'initEvent'].indexOf(obj.action) > -1) {
                            store.addEvent(_this.currentElement, obj);
                            history.addHistory(store.clone(), 138);
                        }
                    }
                } catch (error) {
                    message.message('粘贴操作失败!', 'error');
                }
            } else {
                if (!navigator.clipboard) {
                    alert("浏览器不支持粘贴操作");
                    return;
                }
                /* 从剪贴板中获取粘贴的内容 */
                navigator.clipboard.readText()
                    .then(text => {
                        if (JSON.parse(text)) {
                            let obj = JSON.parse(text);
                            if (['click', 'mouseenter', 'mouseleave', 'initEvent'].indexOf(obj.action) > -1) {
                                store.addEvent(_this.currentElement, JSON.parse(text));
                                history.addHistory(store.clone(), 138);
                            }
                        }
                    })
                    .catch(err => {
                        console.error("粘贴操作失败:", err);
                    });
            }
        },
        clearData() {
            this.cloudMapComponent = null;
            // this.cloudMapList = [];
            // this.instanceList = [];
            // this.viewList = [];
            this.activeName = 'visit';
            this.treeActiveNode = null;
            this.timer.time = 30000;
            this.activeInstanceid = '';
            this.activeViewid = -1;
        },
        tabClick(val, callback) {
            if (val.name === 'view') {
                this.cloudMapList = store.getElementList().filter((item) => item.component === 'CloudMap');
            }
        },
        openUpdateEventPanel(event, index) {
            array.clear(this.eventData);
            array.add(this.eventData, event);
            this.editElementIndex = index;
            this.editType = 'update';
            this.editState = !this.editState;
            this.activeName = event.event;
            this.$nextTick(() => {
                document.getElementById(`${window.getRootName() + 'EVENT_TYPE'}`).value = event.action;
                document.getElementById(`${window.getRootName() + 'EVENT_GROUP'}`).value = event.group;
                // if (event.event === 'visit') {
                //     let checkbox = document.getElementsByName('page-check');
                //     for (var i = 0; i < event.param.length; i++) {
                //         checkbox[event.param[i]].checked = true;
                //     }
                // } else if (event.event === 'alert') {
                //     document.getElementById(window.getRootName() + 'EVENT_MESSAGE').value = event.param;
                // } else if (event.event === 'view') {
                //     this.activeInstanceid = event.param.id;
                //     this.activeViewid = event.param.viewid;
                //     this.tabClick({ name: event.event });
                //     this.cloudMapComponent = this.cloudMapList.filter((item) => item.id === event.param.elementID)[0];
                //     this.setInstanceList(this.cloudMapComponent.data.url, event.param);
                // }
                if (this.currentElement.component == 'Timing') {
                    document.getElementById(`${window.getRootName() + 'EVENT_GROUP'}`).value = event.group;
                    this.timer.time = this.currentElement.event[index].interval;
                }
                if (this.currentElement.component == 'Menu') {
                    this.$refs.menuTree.setCurrentKey(event.node);
                }
                if (this.currentElement.component == 'Tree') {
                    this.$refs.levelTree.setCurrentKey(event.node);
                }
            });
        },
        // 修改时param不为null;
        // async setInstanceList(url, param) {
        //     let data = await socket(url, [
        //         {
        //             command: 100,
        //             details: true
        //         },
        //         {
        //             command: 0
        //         }
        //     ]);
        //     let command = JSON.parse(data[0].data);
        //     let server = JSON.parse(data[1].data);
        //     let instances = command.instances;
        //     let list = new Array();
        //     if (instances) {
        //         for (let a = 0; a < instances.length; a++) {
        //             let instance = {
        //                 nodeIP: instances[a].nodeIP,
        //                 id: instances[a].id,
        //                 playerPort: server.playerPort,
        //                 projectId: instances[a].projectId,
        //                 project: instances[a].project,
        //                 tours: instances[a].tours,
        //                 viewid: -1
        //             };
        //             list.push(instance);
        //         }
        //     }
        //     this.instanceList = list;
        //     this.activeInstanceid = param.id;
        //     this.activeViewid = param.viewid;
        //     let instanceList = this.instanceList.filter((item) => item.id === param.id);
        //     if (instanceList.length) {
        //         let viewList = instanceList[0].tours;
        //         let list = [];
        //         if (viewList) {
        //             for (let a = 0; a < viewList.length; a++) {
        //                 let rs = {};
        //                 rs.name = viewList[a];
        //                 rs.id = a;
        //                 list.push(rs);
        //             }
        //         }
        //         this.viewList = list;
        //         if (param.viewid >= viewList.length) {
        //             this.activeViewid = -1;
        //         }
        //     } else {
        //         this.viewList = [];
        //         this.activeInstanceid = '';
        //         this.activeViewid = -1;
        //     }
        // },
        // setInstance(row) {
        //     this.viewList = [];
        //     this.activeInstanceid = row.id;
        //     let instanceObject = this.instanceList.filter((item) => item.id === row.id)[0];
        //     let viewList = instanceObject.tours;
        //     let list = [];
        //     if (viewList) {
        //         for (let a = 0; a < viewList.length; a++) {
        //             let rs = {};
        //             rs.name = viewList[a];
        //             rs.id = a;
        //             list.push(rs);
        //         }
        //     }
        //     this.viewList = list;
        //     this.activeViewid = instanceObject.id === this.cloudMapComponent.data.id ? this.cloudMapComponent.data.viewid : -1;
        // },
        removeElementEvent(event) {
            message.confirm(
                '是否删除事件',
                '',
                function() {
                    message.message('删除成功！', 'success');
                    store.removeEvent(store.getCurrentElementList()[0], event);
                    history.addHistory(store.clone(), 140);       
                },
                function() {
                    message.message('已取消删除！', 'info');
                }
            );
        },
        copyElementEvent(event) {
            if (user.getPanel() === 'true') {
                this.eventPase = JSON.stringify(event);
                message.message('复制成功！', 'success');
            } else {
                this.$copyText(JSON.stringify(event)).then(
                    function(e) {
                        message.message('复制成功！', 'success');
                    },
                    function(e) {
                        message.message('复制失败！', 'error');
                    }
                );
            }
        },
        getEventParam() {
            let data = bus.getEventData()[0];
            if (data.error) {
                return data;
            } else {
                let elementEvent = {
                    id: util.getID(),
                    event: this.activeName,
                    param: data,
                    group: Number(document.getElementById(`${window.getRootName() + 'EVENT_GROUP'}`).value),
                    action: document.getElementById(`${window.getRootName() + 'EVENT_TYPE'}`).value
                };
                if (this.currentElement.component == 'Timing') {
                    elementEvent.interval = this.timer.time;
                }
                if (this.currentElement.component == 'Tree' || this.currentElement.component == 'Menu') {
                    elementEvent.node = this.treeActiveNode ? this.treeActiveNode.id : null;
                }
                return elementEvent;
            }
            // let param = null;
            // if (this.activeName === 'alert') {
            //     param = document.getElementById(window.getRootName() + 'EVENT_MESSAGE').value;
            // } else if (this.activeName === 'visit') {
            //     let checkbox = document.getElementsByName('page-check');
            //     let arr = [];
            //     for (var i = 0; i < checkbox.length; i++) {
            //         if (checkbox[i].checked === true) {
            //             arr.push(Number(checkbox[i].value));
            //         }
            //     }
            //     param = arr;
            // } else if (this.activeName === 'view') {
            //     param = {
            //         elementID: this.cloudMapComponent.id, // 组件id
            //         nodeIP: this.cloudMapComponent.data.nodeIP, // 实例服务ip
            //         playerPort: this.cloudMapComponent.data.playerPort, // 视频流端口
            //         id: this.activeInstanceid, // 实例id
            //         projectId: this.cloudMapComponent.data.projectId, // 工程id
            //         viewid: this.activeViewid // 导览序列
            //     };
            // }
            // let elementEvent = {
            //     id: util.getID(),
            //     event: this.activeName,
            //     param: param,
            //     group: Number(document.getElementById(`${window.getRootName() + 'EVENT_GROUP'}`).value),
            //     action: document.getElementById(`${window.getRootName() + 'EVENT_TYPE'}`).value
            // };
            // if (this.currentElement.component == 'Timing') {
            //     elementEvent.interval = this.timer.time;
            // }
            // if (this.currentElement.component == 'Tree' || this.currentElement.component == 'Menu') {
            //     elementEvent.node = this.treeActiveNode ? this.treeActiveNode.id : null;
            // }
            // return elementEvent;
        },
        addElementEvent() {
            let errorList = [];
            // if (this.activeName === 'view' && !this.cloudMapComponent) {
            //     message.message('未选择实例!', 'warning');
            //     return;
            // }
            // if (document.getElementById(`${window.getRootName() + 'EVENT_TYPE'}`).value === '') {
            //     message.message('未选择事件类型!', 'warning');
            //     return;
            // }
            if ((this.currentElement.component === 'Menu' || this.currentElement.component === 'Tree') && !this.treeActiveNode) {
                errorList.push('没有选择层级树的节点！');
            }
            // if (this.activeName === 'alert') {
            //     let param = document.getElementById(window.getRootName() + 'EVENT_MESSAGE').value;
            //     if (param === '') return message.message('请输入要弹出的消息内容!', 'warning');
            // }
            let eventParam = this.getEventParam();
            if (eventParam.error) {
                array.addAll(errorList, eventParam.message);
            }
            if (errorList.length == 0) {
                let interval = eventParam.interval;
                if (this.editType === 'add') {
                    for (let i = 0; i < this.currentElement.event.length; i++) {
                        this.currentElement.event[i].interval = interval;
                    }
                    store.addEvent(this.currentElement, eventParam);
                    history.addHistory(store.clone(), 138);
                } else {
                    let elementEvent = this.currentElement.event[this.editElementIndex];
                    for (let key in elementEvent) {
                        elementEvent[key] = eventParam[key];
                    }
                    for (let i = 0; i < this.currentElement.event.length; i++) {
                        this.currentElement.event[i].interval = interval;
                    }
                    history.addHistory(store.clone(), 139);
                }
                this.closePanel();
            } else {
                let str = '';
                if (errorList.length > 1) {
                    for (let i = 0; i < errorList.length; i ++) {
                        if (i > 0) {
                            str += '\n';
                        }
                        str += (i + 1) + '、' + errorList[i];
                    }
                } else {
                    str = errorList[0];
                }
                message.message(str, 'warning');
            }
        },
        updateElementEvent() {
            if (this.activeName === 'alert') {
                let param = document.getElementById(window.getRootName() + 'EVENT_MESSAGE').value;
                if (param === '') return message.message('请输入要弹出的消息内容!', 'warning');
            }
            let eventParam = this.getEventParam();
            let interval = eventParam.interval;
            let elementEvent = this.currentElement.event[this.editElementIndex];
            for (let key in elementEvent) {
                elementEvent[key] = eventParam[key];
            }
            for (let i = 0; i < this.currentElement.event.length; i++) {
                this.currentElement.event[i].interval = interval;
            }
            this.currentElementEventList = this.currentElement.event;
            history.addHistory(store.clone(), 139);
            this.closePanel();
        },
        closePanel() {
            this.editState = false;
            this.clearData();
        }
    }
};
</script>

<style lang='scss' scoped>
.event {
    max-height: $attrMaxHeight;
    overflow-y: auto;
    overflow-x: hidden;
    .event-list {
        max-height: 400px;
        overflow-y: auto;
        .el-timeline {
            color: #ffffff80;
            position: relative;
            font-weight: 600;
            font-size: 13px;
            padding: 2px 2px 0 2px;
            // min-height: 90px;
            cursor: pointer; 
            // border: 1px solid #3662ec00;
            // border-bottom: 1px solid #424344 !important;
            background: #293037;
            border-radius: 4px;
            margin-bottom: 10px;
            overflow: hidden;
            &:hover {
                // border: 1px solid #3662ec4d;
                // box-shadow: 0 0 6px 0 #1e68cf, inset 0 0 6px 0 #1e68cf;
                box-shadow: 0 0 0 2px #0D99FF inset;
                z-index: 1;
                transform: translate3d(0, 0, 0);
                .el-icon-delete, .el-icon-copy-document {
                    display: block;
                    &:hover {
                        color: #1e68cf
                    }
                }
            }
            &:last-child {
                font-size: 12px;
            }
            .el-icon-delete {
                display: none;
                font-size: 14px;
                position: absolute;
                right: 10px;
                top: 10px;
                cursor: pointer;
                color: #ffffff;
                z-index: 2;
            }
            .el-icon-copy-document {
                display: none;
                font-size: 14px;
                position: absolute;
                right: 30px;
                top: 10px;
                cursor: pointer;
                color: #ffffff;
                z-index: 2;
            }
            .event-warp-title {
                position: relative;
                display: flex;
                color: #CACFED;
                font-size: 12px;
                height: 28px;
                line-height: 28px;
                background-color: #323A42;
                padding-left: 10px;
            }
            .event-warp {
                display: flex;
                align-items: center;
                // padding-left: 30px;
                position: relative;
                margin: 10px 0;
                font-size: 12px;
                padding: 0 10px;
                color: #7F7F7F;
            }
            .evevt-icon {
                width: 14px;
                height: 14px;
                margin-right: 10px;
                // position: absolute;
                // left: 0px;
                // top: 2px;
            }
            .evevt-divider {
                border: 1px solid #CACFED;
                position: absolute;
                width: 1px;
                height: 16px;
                left: 16px;
                top: 16px;
            }
            .event-param {
                // background: #ffffff0f;
                border-radius: 2px;
                min-height: 28px;
                white-space: nowrap;
                text-overflow: ellipsis;
                -o-text-overflow: ellipsis;
                overflow: hidden;
                padding: 5px 10px;
                font-size: 12px;
                width: 100%;
                border: 1px solid #323A42;
            }
        }
    }
    .event-type {
        margin: 5px 0 0 0;
        .el-tabs {
            margin-top: 10px;
        }
        .page-warp {
            min-height: 85px;
            .page-title {
                display: flex;
                height: 65px;
                justify-content: center;
                align-items: center;
                color: #ffffff;
                font-size: 12px;
            }
            .exclusive-item {
                margin: 5px;
                display: flex;
                align-items: center;
                span {
                    margin-left: 10px;
                    color: #ffffff80;
                    font-size: 13px;
                }
            }
        }
        ::v-deep.el-tree {
            position: relative;
            cursor: default;
            background: transparent;
            color: #ffffff !important;
            width: 220px;
            font-weight: 400 !important;
            .el-tree-node__label {
                font-size: 12px !important;
            }
        }
        ::v-deep.el-checkbox.is-bordered.el-checkbox--small {
            border-radius: 2px;
            width: 220px;
            margin: 0 0 0 10px;
            height: 30px;
            border: 1px solid #3662ec00;
            color: $FontWhite;
            font-size: 12px;
            background: transparent;
        }
        ::v-deep.el-checkbox.is-bordered.el-checkbox--small {
            margin: 1px 0 !important;
        }
        .el-tabs {
            width: 220px;
            margin-left: 10px;
        }
        /* ::v-deep.el-tabs__item {
            color: #ffffff;
        } */
        ::v-deep.el-tabs__nav-scroll {
            padding-left: 0;
        }
        ::v-deep.el-tabs__content {
            padding: 10px 0 0 0;
            overflow-x: hidden;
        }
        ::v-deep.el-tabs__item {
            font-size: 12px;
        }
    }
    .add-event {
        height: 30px;
        line-height: 30px;
        background: #ffffff0f;
        color: $FontWhite;
        text-align: center;
        border-radius: 5px;
        margin-top: 10px;
        cursor: pointer;
        &:hover {
            background: #ffffff33;
        }
    }
    .edit-btn {
        padding-left: 5px;
    }
    .map-content {
        display: flex;
        justify-content: space-between;
        margin-top: 10px;
        .main-text-tran-50 {
            padding-left: 10px;
        }
    }
    .main-text-tran-50 {
        font-weight: 600;
        line-height: 30px;
        min-width: 40px;
    }
    .event-attr-wrap {
        display: flex;
        margin: 5px 0;
    }
    .event-attr-name {
        width: 60px;
        font-size: 12px;
    }
    .event-attr-content {
        width: 145px;
        margin-right: 5px;
    }
    .main-mas-input-simple {
        width: calc(100% - 70px);
    }
    .table {
        width: 100%;
        min-height: 50px;
        max-height: 200px;
        overflow-y: auto;
        overflow-x: hidden;
        border-radius: 10px;
        .activeTable {
            background: #3664ec !important;
        }
        .label {
            width: calc(100% - 10px);
            height: 25px;
            line-height: 25px;
            margin: 3px 2px;
            border-radius: 2px;
            padding-left: 8px;
            cursor: pointer;
            span {
                color: #ffffff;
            }
            &:active {
                background: #3664ec;
            }
            &:hover {
                background: #2d2d2d;
            }
        }
    }
}
::v-deep .el-select .el-select__tags > span {
    display: flex;
    overflow: hidden;
}
.small-ipt {
    width: 65px;
    font-weight: normal;
}
</style>